﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Dt261.Views
{
    class TLBIcon
    {

        public static Line GetLine(int centerX,int centerY,int length, Color color)
        {
            Line line = new Line();
            line.Stroke = new SolidColorBrush(color);

            line.Y1 = centerY - 5;
            line.X1 = centerX - 5;
            line.Y2 = centerY + 5;
            line.X2 = centerX + 5;
            line.StrokeThickness = 1;

            return line;
        }

        public static void DrawNoRespIconByType(double centerX, double centerY, bool isright, Canvas canves, List<Shape> wheretoadd = null)
        {
            Color color = isright ? Color.FromRgb(0xff, 0, 0) : Color.FromRgb(0, 0, 0xff);


            {
                Line line = new Line();
                line.Stroke = new SolidColorBrush(color);

                line.Y1 = centerY + 4;
                line.X1 = centerX - 4;
                line.Y2 = line.Y1 + 4;
                line.X2 = line.X1 - 4;
                line.StrokeThickness = 1;
                canves.Children.Add(line);
                wheretoadd.Add(line);
            }
            {
                Line line = new Line();
                line.Stroke = new SolidColorBrush(color);

                line.Y1 = centerY + 8;
                line.X1 = centerX - 8;
                line.Y2 = line.Y1 - 4;
                line.X2 = line.X1;
                line.StrokeThickness = 1;
                canves.Children.Add(line);
                wheretoadd.Add(line);
            }
            {
                Line line = new Line();
                line.Stroke = new SolidColorBrush(color);

                line.Y1 = centerY + 8;
                line.X1 = centerX - 8;
                line.Y2 = line.Y1;
                line.X2 = line.X1 + 4;
                line.StrokeThickness = 1;
                canves.Children.Add(line);
                wheretoadd.Add(line);
            }
        }

            public static void DrawIconByType(double centerX, double centerY, int type, bool isright,Canvas canves, List<Shape> wheretoadd=null)
        {
            int width = 10;
            Color color = isright ? Color.FromRgb(0xff, 0, 0) : Color.FromRgb(0, 0, 0xff);
           // if (isright)
            {
                switch(type)
                {
                    case 1://右耳非掩蔽
                        {
                            Ellipse dataEllipse = new Ellipse();
                            // dataEllipse.Fill = new SolidColorBrush(color);
                            dataEllipse.Stroke = new SolidColorBrush(color);
                            dataEllipse.Width = 10;
                            dataEllipse.Height = 10;
                            Canvas.SetTop(dataEllipse, centerY - 5);
                            Canvas.SetLeft(dataEllipse, centerX - 5);
                            canves.Children.Add(dataEllipse);
                            wheretoadd.Add(dataEllipse);
                        }
                        break;
                    case 2://左耳非掩蔽
                        {
                            Line line = new Line();
                            line.Stroke = new SolidColorBrush(color);
                            line.Y1 = centerY - 5;
                            line.X1 = centerX - 5;
                            line.Y2 = centerY + 5;
                            line.X2 = centerX + 5;
                            line.StrokeThickness = 1;
                            canves.Children.Add(line);
                            wheretoadd.Add(line);
                        }
                        {
                            Line line = new Line();
                            line.Stroke = new SolidColorBrush(color);
                            line.Y1 = centerY + 5;
                            line.X1 = centerX - 5;
                            line.Y2 = centerY - 5;
                            line.X2 = centerX + 5;
                            line.StrokeThickness = 1;
                            canves.Children.Add(line);
                            wheretoadd.Add(line);
                        }
                        break;
                    case 3:
                        {
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY;
                                line.X1 = centerX + 5;
                                line.Y2 = line.Y1 + 5;
                                line.X2 = line.X1 - 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY;
                                line.X1 = centerX + 5;
                                line.Y2 = line.Y1 - 5;
                                line.X2 = line.X1 - 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    case 4:
                        {
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 + 5;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 - 5;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    case 5://xgwen
                        {
                            {
                                {
                                    Line line = new Line();
                                    line.Stroke = new SolidColorBrush(color);

                                    line.Y1 = centerY - 5;
                                    line.X1 = centerX + 5;
                                    line.Y2 = line.Y1 + 10;
                                    line.X2 = line.X1;
                                    line.StrokeThickness = 1;
                                    canves.Children.Add(line);
                                    wheretoadd.Add(line);
                                }
                                {
                                    Line line = new Line();
                                    line.Stroke = new SolidColorBrush(color);

                                    line.Y1 = centerY - 5;
                                    line.X1 = centerX + 5;
                                    line.Y2 = line.Y1 + 5;
                                    line.X2 = line.X1 - 10;
                                    line.StrokeThickness = 1;
                                    canves.Children.Add(line);
                                    wheretoadd.Add(line);
                                }
                                {
                                    Line line = new Line();
                                    line.Stroke = new SolidColorBrush(color);

                                    line.Y1 = centerY + 5;
                                    line.X1 = centerX + 5;
                                    line.Y2 = line.Y1-5;
                                    line.X2 = line.X1 - 10;
                                    line.StrokeThickness = 1;
                                    canves.Children.Add(line);
                                    wheretoadd.Add(line);
                                }
                            }
                        }
                        break;
                    case 6://xgwen
                        {
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY + 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 - 10;
                                line.X2 = line.X1;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY +5 ;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 - 5;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY -5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 +5;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    
                    case 7:
                        {
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 + 0;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY + 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    case 8:
                        {
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX + 5;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1 + 0;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY + 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    case 9://
                        {
                            Rectangle rect = new Rectangle();
                            //(40 + px * hzsint.IndexOf(hz), 280, px, py * (120 - value));

                            rect.Stroke = new SolidColorBrush(color);

                            rect.Height = 10.0;


                            rect.Width = 10.0;
                            Canvas.SetLeft(rect, centerX - 5);
                            Canvas.SetTop(rect, centerY - 5);

                            canves.Children.Add(rect);
                            wheretoadd.Add(rect);
                        }

                        break;
                    case 10:
                        {
                            //三角形
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1 - 5;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1 + 5;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY + 5;
                                line.X1 = centerX - 5;
                                line.Y2 = line.Y1;
                                line.X2 = line.X1 + 10;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                        }
                        break;
                    case 13:
                        {
                            //
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1 - 5;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                            {
                                Line line = new Line();
                                line.Stroke = new SolidColorBrush(color);

                                line.Y1 = centerY - 5;
                                line.X1 = centerX;
                                line.Y2 = line.Y1 + 10;
                                line.X2 = line.X1 + 5;
                                line.StrokeThickness = 1;
                                canves.Children.Add(line);
                                wheretoadd.Add(line);
                            }
                       
                        }
                        break;
                }
            }
   
        }
    }
}
